package edu.gatech.ece6102;

import edu.gatech.ece6102.beans.AddressBean;

import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
import java.io.IOException;
import java.net.*;

/**
 * User: deepal
 * Date: Sep 28, 2010
 * Time: 5:34:39 PM
 */
public class MainControler {
    public static void main(String[] args) throws IOException, InterruptedException {
//        SocketFactory serverSocketFactory =SocketFactory.getDefault();
//       Socket socketToServer = serverSocketFactory.createSocket("127.0.0.1", 8080);
//        URL url = new URL("http://localhost:8080");
//        URLConnection connection =url.openConnection();
//        LoadBalancer loadBalancer = new LoadBalancer();
//        AddressBean bean = new AddressBean();
//        bean.setIp("localhost");
//        bean.setPort(8080);
//        loadBalancer.getExecutor().addAppServer(bean);
//        loadBalancer.run();
        Socket socket = new Socket("node4.opencirrus.infosphere.emulab.net", 6666);
        String value = "ADD:node2:8080:Tomcat2\n";
        socket.getOutputStream().write(value.getBytes());
        socket.getOutputStream().flush();
        Thread.sleep(100);
    }
}
